<template>
  <div id="home">
    <div class="popularActivities">
      <div class="header">
        <div class="title-text">
          <div class="title">讲座与学员活动</div>
          <div class="title-txt">专家讲座、学员活动</div>
        </div>
        <div class="moreBtn">查看更多<i class="el-icon-arrow-right"></i></div>
      </div>
      <div class="section-box">
        <div class="card-item" v-for="item in listData" :key="item?.id">
          <img :src="item?.url" alt="" />
          <div class="class-text">
            <div class="class-name">{{ item?.name }}</div>
            <div class="class-sign">
              <span
                class="sign-item"
                v-for="signItem in item?.sign"
                :key="signItem"
                >{{ signItem }}</span
              >
            </div>
            <div class="class-price">
              <span class="price">￥ {{ item?.price }}</span>
              <span class="btn">立即报名</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "homePage",
  components: {},
  data() {
    return {
      listData: [
        {
          id: 1,
          url: require("../assets/img/1707189486771_软考封面.png"),
          name: "软考高级-信息系统项目管理师",
          sign: ["线上", "免费报名中"],
          price: 0,
        },
        {
          id: 2,
          url: require("../assets/img/f6308e8dfe0674f441f831b49b6de788.png"),
          name: "_如何有效沟通，项目经理的第一挑战.mp4",
          sign: ["线上", "免费报名中"],
          price: 0,
        },
        {
          id: 3,
          url: require("../assets/img/1709524417725_封面图.png"),
          name: "24年网络安全攻防实战训练营.mp4",
          sign: ["线上", "可使用助学金全额购买"],
          price: 1,
        },
        {
          id: 4,
          url: require("../assets/img/3c388ebc419a28982262bdc779f53bfb.jpg"),
          name: "2024开年第一课：蓄势增长，扬帆起航",
          sign: ["线上", "免费报名中"],
          price: 0,
        },
        {
          id: 5,
          url: require("../assets/img/1d475b14fe9ec12751fb82566aea3716.png"),
          name: "轻松实现Linux系统性能调优",
          sign: ["线上", "可使用助学金全额购买"],
          price: 1,
        },
        {
          id: 6,
          url: require("../assets/img/bc41fd8be261004d8f8fb99144cf9ff6.png"),
          name: "DAMA摸透数据治理的“道”和“法”",
          sign: ["直播", "可使用助学金抵扣80%"],
          price: 59.9,
        },
      ],
    };
  },
};
</script>

<style scoped lang="less">
#home {
  width: 100%;
  min-height: 200px;
  .popularActivities {
    width:1150px;
    margin: 0 auto;
    .header {
      align-items: center;
      display: flex;
      justify-content: space-between;
      margin: 0 auto 21px;
      width: 1200px;
      .title-text {
        align-items: center;
        display: flex;
        .title {
          color: #202226;
          font-family: MicrosoftYaHei;
          font-size: 24px;
          font-weight: 700;
        }
        .title-txt {
          color: #7b808c;
          font-family: MicrosoftYaHei;
          font-size: 14px;
          height: 19px;
          line-height: 19px;
          margin-left: 16px;
        }
      }
      .moreBtn {
        color: #7b808c;
        cursor: pointer;
        font-family: MicrosoftYaHei;
        font-size: 14px;
      }
    }
    .section-box {
      width: 100%;
      display: flex;
      flex-wrap: wrap;
    }
    .card-item {
      background: url("../assets/img/class-card.cffa2c7.png") no-repeat 50%;
      background-size: contain;
      cursor: pointer;
      height: 346px;
      padding: 0 13px 24px;
      position: relative;
      width: 306px;
      margin-right: 20px;
      img {
        border-radius: 8px 8px 0 0;
        height: 157px;
        width: 100%;
        border: 0;
        vertical-align: top;
      }
      .class-text {
        padding: 11px 16px 12px;
        .class-name {
          color: #202226;
          display: -webkit-box;
          font-family: MicrosoftYaHei;
          font-size: 14px;
          font-weight: 700;
          line-height: 22px;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: normal;
        }
        .class-sign {
          margin-top: 20px;
          min-height: 20px;
          .sign-item {
            background-color: #e9eef5;
            border-radius: 4px;
            color: #86909c;
            font-size: 12px;
            margin-right: 5px;
            padding: 3px 6px;
          }
        }
        .class-price {
          margin-top: 20px;
          min-height: 20px;
          display: flex;
          justify-content: space-between;
          .price {
            color: #ff7800;
            font-size: 18px;
            font-weight: 700;
          }
          .btn {
            border-radius: 16px;
            color: #fff;
            display: inline-block;
            font-size: 14px;
            height: 32px;
            line-height: 32px;
            text-align: center;
            width: 100px;
            z-index: 99;
            background-color: #f45f16;
          }
        }
      }
    }
  }
}
</style>